Skip to content

feat(oauth): Forward the OIDC prompt from the authorize page - #130413

Open
sentry-junior[bot] wants to merge 3 commits into
masterfrom
feat/oauth-oidc-prompt-frontend
Open

sentry-junior[bot] wants to merge 3 commits into
masterfrom
feat/oauth-oidc-prompt-frontend

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

This is the frontend half of standard OIDC prompt support on /oauth/authorize/. The server enforcement is in #130412. It is approach D from getsentry/toolkit#1925.

The authorize page now forwards prompt to authorization context and consent preparation. Everything else follows from what the server returns:

  • consent / select_account: the server reports no existing consent, so the page shows the consent step with Switch account instead of approving silently. No frontend logic was added. force_prompt still works as before.
  • login: when consent preparation returns {"stage": "reauthenticate"}, the page signs out through the same path as Switch account and shows the sign-in form. That way the existing session can't satisfy the request. Signing in starts a new session, and consent is prepared again. If sign-out fails, the page shows the error with Start over.
  • none: the server redirects with login_required / consent_required / interaction_required / invalid_request, or the existing auto-approve path runs. The page only shows its loading state.

Either PR can merge first. Without #130412, the server ignores prompt, which is today's behavior.

Screenshots (local devserver with both PRs, app already approved for project:read)

prompt=select_account (before: approved silently, no UI) prompt=login after the session's sign-in is over 60s old
Consent step with Switch account Sign-in form after signing out

I also checked these locally without screenshots, since no UI renders: prompt=none while signed out went to callback?error=login_required&state=xyz. With an unapproved scope it went to error=consent_required. With existing consent it went to callback?code=…&state=xyz. prompt=none login went to error=invalid_request. After signing in again from the prompt=login form, the page went straight to callback?code=….

The prompt=login design (60-second sign-in window, re-auth by signing out) is settled in #130412.

via @BYK.

--

View Session in Sentry

Pass the prompt parameter to authorization context and consent
preparation so the server can enforce it. When the server asks a
prompt=login request to reauthenticate, sign out and show the sign-in
form, so the existing session cannot satisfy it. Signing in prepares
consent again for the new session.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 9, 2026
@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 9, 2026 12:50
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 9, 2026 12:50
…mpt-frontend

# Conflicts:
#	static/app/views/authV2/oauth/queries.ts
#	static/app/views/authV2/oauthAuthorize/useOAuthAuthorizeFlow.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f3cc8b3. Configure here.

Start over kept the switchAccount mutation error, so the next
reauthenticate response showed the same error again before sign-out
was retried.

This branch was successfully deployed

1 active deployment
Preview — a0c51f46 Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant